using System;
using System.Configuration;

namespace TimelineNet.Library {
    [Serializable()]
    public class Zone {
        public DateTime Start;
        public DateTime End;
        public int Magnify;
        public Enums.TimelineDateTime Unit = Enums.TimelineDateTime.WEEK;
        public Zone() {
        }
        public Zone(DateTime Start, DateTime End, int Magnify, Enums.TimelineDateTime Unit) {
            this.Start = Start;
            this.End = End;
            this.Magnify = Magnify;
            this.Unit = Unit;
        }

        public override string ToString() {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append("{");
            if(Start != null && Start != DateTime.MinValue) sb.Append("     start:  \"" + Start.ToUniversalTime() + "\", ");
            if(End != null && End != DateTime.MinValue) sb.Append("     end:    \"" + End.ToUniversalTime() + "\", ");
            if(Magnify > 0) sb.Append("     magnify:    " + Magnify.ToString() + ", ");
            sb.Append("     unit:    Timeline.DateTime." + Unit.ToString());
            sb.Append("}\n");
            return sb.ToString();
        }
        /*
         {   start:    "Aug 01 2006 00:00:00 GMT-0500",
                        end:      "Sep 01 2006 00:00:00 GMT-0500",
                        magnify:  10,
                        unit:     Timeline.DateTime.WEEK
                    },
         */
    }
}